package com.tang.boot.config;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

public class SpringApplication {

    public static void run() {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8000);
        try {
            tomcat.addWebapp("/","/Users/mac2015/tang/");
            tomcat.start();
            tomcat.getServer().await();
        } catch (ServletException | LifecycleException e) {
            e.printStackTrace();
        }

    }
}
